package com.lighthouse.base.common.service;

import com.lighthouse.base.common.dao.generalDAO;
import com.lighthouse.base.common.vo.FileVO;

import java.awt.image.renderable.ParameterBlock;
import java.io.*;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;


@Service("FileService")
public class FileManagerImpl implements FileManager {

    @Resource (name = "generalDao")
    generalDAO generalDao;
    protected Log logger = LogFactory.getLog(FileManagerImpl.class);

    public FileVO getFileInfo(int fileId) {
        if(logger.isDebugEnabled()) logger.debug(fileId);

        try {
            //return generalDao.listWithPaging("fileManage_searchList", fileInfo, fileInfo.getFirstIndex(), fileInfo.getRecordCountPerPage());
            return (FileVO)generalDao.getObject("fileManage_getfileinfo", fileId);
        }
        catch(Exception e) {
            if(logger.isDebugEnabled()) logger.debug(String.format("[FileManagerImpl.getFileInfo]:%s",e.toString()));
        }
        return null;
    }

}
